<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>天气Block-缩影信息</title>
    <!--加载 缩影 CSS-->
    <link rel="stylesheet" href="public/css/block/weather.css">
</head>
<body>
    <div class="container">
        <!--天气 Block-->
        <div class="Block">
            <div class="weather">
                <div class="weather_title">当天</div>
                <div class="weather_left">
                    <img alt="天气" src="" class="weather_img" width="100%">
                </div>
                <div class="weather_right">
                    24°
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
    <script type="text/javascript" defer>
 	    $(document).ready(function(){
 	    	var city = json.soryin.blockId.address.city;	//获取城市
 	    	$.ajax({
 	            type:'post',
 	           	dataType: 'jsonp',
 		　　    	jsonp: 'callback',
 	           	url: "http://sy.hais1992.com/SoryinServerDB/Tools_getJsonp",
 	            data:'key=Soryin&url=http://api.map.baidu.com/telematics/v3/weather?location='+city+'%26output=json%26ak=Kupb0NGlUGZ20jFFyeFmzeH6',   //ak省略
 	            success:function(data){
 	            	json = $.parseJSON(data);	//获取json

 	            	var weather_img=json.json.results[0].weather_data[0].dayPictureUrl;
 	            	var weather_right=json.json.results[0].weather_data[0].temperature;

 	            	$(".weather_img").attr("src",weather_img);		//加载图片
 	            	$(".weather_right").html(weather_right.substring(0,2)+'°');	//显示到html上
 	            }
 	        });
 	    	

 	    	
 	    	
	    }); 
    </script>
</body>
</html>